3.7.69 \(\int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx\) [669]

Optimal. Leaf size=32 \[ \frac {a A c \tan (e+f x)}{f}+\frac {a B c \tan ^2(e+f x)}{2 f} \]

[Out]

a*A*c*tan(f*x+e)/f+1/2*a*B*c*tan(f*x+e)^2/f

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 32, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.027, Rules used = {3669} \begin {gather*} \frac {a A c \tan (e+f x)}{f}+\frac {a B c \tan ^2(e+f x)}{2 f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]),x]

[Out]

(a*A*c*Tan[e + f*x])/f + (a*B*c*Tan[e + f*x]^2)/(2*f)

Rule 3669

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a*(c/f), Subst[Int[(a + b*x)^(m - 1)*(c + d*x)^(n - 1)*(A + B*x), x
], x, Tan[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, A, B, m, n}, x] && EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x)) \, dx &=\frac {(a c) \text {Subst}(\int (A+B x) \, dx,x,\tan (e+f x))}{f}\\ &=\frac {a A c \tan (e+f x)}{f}+\frac {a B c \tan ^2(e+f x)}{2 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 32, normalized size = 1.00 \begin {gather*} \frac {a B c \sec ^2(e+f x)}{2 f}+\frac {a A c \tan (e+f x)}{f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x])*(c - I*c*Tan[e + f*x]),x]

[Out]

(a*B*c*Sec[e + f*x]^2)/(2*f) + (a*A*c*Tan[e + f*x])/f

________________________________________________________________________________________

Maple [A]
time = 0.05, size = 27, normalized size = 0.84

method result size
derivativedivides \(\frac {a c \left (\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f}\) \(27\)
default \(\frac {a c \left (\frac {B \left (\tan ^{2}\left (f x +e \right )\right )}{2}+A \tan \left (f x +e \right )\right )}{f}\) \(27\)
norman \(\frac {a A c \tan \left (f x +e \right )}{f}+\frac {a B c \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}\) \(31\)
risch \(\frac {2 a c \left (i A \,{\mathrm e}^{2 i \left (f x +e \right )}+B \,{\mathrm e}^{2 i \left (f x +e \right )}+i A \right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2}}\) \(50\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

1/f*a*c*(1/2*B*tan(f*x+e)^2+A*tan(f*x+e))

________________________________________________________________________________________

Maxima [A]
time = 0.50, size = 31, normalized size = 0.97 \begin {gather*} \frac {B a c \tan \left (f x + e\right )^{2} + 2 \, A a c \tan \left (f x + e\right )}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x, algorithm="maxima")

[Out]

1/2*(B*a*c*tan(f*x + e)^2 + 2*A*a*c*tan(f*x + e))/f

________________________________________________________________________________________

Fricas [C] Result contains complex when optimal does not.
time = 2.82, size = 57, normalized size = 1.78 \begin {gather*} -\frac {2 \, {\left ({\left (-i \, A - B\right )} a c e^{\left (2 i \, f x + 2 i \, e\right )} - i \, A a c\right )}}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x, algorithm="fricas")

[Out]

-2*((-I*A - B)*a*c*e^(2*I*f*x + 2*I*e) - I*A*a*c)/(f*e^(4*I*f*x + 4*I*e) + 2*f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 0.16, size = 82, normalized size = 2.56 \begin {gather*} \frac {2 i A a c + \left (2 i A a c e^{2 i e} + 2 B a c e^{2 i e}\right ) e^{2 i f x}}{f e^{4 i e} e^{4 i f x} + 2 f e^{2 i e} e^{2 i f x} + f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x)

[Out]

(2*I*A*a*c + (2*I*A*a*c*exp(2*I*e) + 2*B*a*c*exp(2*I*e))*exp(2*I*f*x))/(f*exp(4*I*e)*exp(4*I*f*x) + 2*f*exp(2*
I*e)*exp(2*I*f*x) + f)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 113 vs. \(2 (32) = 64\).
time = 0.54, size = 113, normalized size = 3.53 \begin {gather*} \frac {B a c \tan \left (f x\right )^{2} \tan \left (e\right )^{2} - 2 \, A a c \tan \left (f x\right )^{2} \tan \left (e\right ) - 2 \, A a c \tan \left (f x\right ) \tan \left (e\right )^{2} + B a c \tan \left (f x\right )^{2} + B a c \tan \left (e\right )^{2} + 2 \, A a c \tan \left (f x\right ) + 2 \, A a c \tan \left (e\right ) + B a c}{2 \, {\left (f \tan \left (f x\right )^{2} \tan \left (e\right )^{2} - 2 \, f \tan \left (f x\right ) \tan \left (e\right ) + f\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e))*(c-I*c*tan(f*x+e)),x, algorithm="giac")

[Out]

1/2*(B*a*c*tan(f*x)^2*tan(e)^2 - 2*A*a*c*tan(f*x)^2*tan(e) - 2*A*a*c*tan(f*x)*tan(e)^2 + B*a*c*tan(f*x)^2 + B*
a*c*tan(e)^2 + 2*A*a*c*tan(f*x) + 2*A*a*c*tan(e) + B*a*c)/(f*tan(f*x)^2*tan(e)^2 - 2*f*tan(f*x)*tan(e) + f)

________________________________________________________________________________________

Mupad [B]
time = 8.42, size = 25, normalized size = 0.78 \begin {gather*} \frac {a\,c\,\mathrm {tan}\left (e+f\,x\right )\,\left (2\,A+B\,\mathrm {tan}\left (e+f\,x\right )\right )}{2\,f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i)*(c - c*tan(e + f*x)*1i),x)

[Out]

(a*c*tan(e + f*x)*(2*A + B*tan(e + f*x)))/(2*f)

________________________________________________________________________________________